using System;
using System.Data;

using Wicresoft.Common;

namespace Wicresoft.Messages.Entity
{
	[Table("BatchMobile", "", "Wicresoft.Messages.ConnectionString")]
	public class BatchMobile : Info
	{
		#region SQL column name consts 
		public const string SQLCOL_BATCHID = "BatchID";
		public const string SQLCOL_SENDTIME = "SendTime";
		public const string SQLCOL_TEXT = "Text";
		public const string SQLCOL_STATUS = "Status";
		public const string SQLCOL_FILENAME = "FileName";
		public const string SQLCOL_SENDERNAME = "SenderName";
		public const string SQLCOL_SENDERDISPLAYNAME = "SenderDisplayName";
		#endregion


		#region Contructors
		/// <summary>
		/// Construct empty entity
		/// </summary>
		public BatchMobile () {}

		/// <summary>
		/// Construct entity by primary key, other fields will be assigned by 
		/// "Load" method.
		/// </summary>
		public BatchMobile (Guid BatchID)
		{
			this.BatchID = BatchID;
		}
		#endregion

		public override void Init (DataRow row)
		{
			BatchID = (Guid)ObjectType.GuidTypeHelper.Read(row[SQLCOL_BATCHID]);
			SendTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_SENDTIME]);
			Text = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_TEXT]);
			Status = (short)ObjectType.ShortTypeHelper.Read(row[SQLCOL_STATUS]);
			FileName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_FILENAME]);
			SenderName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_SENDERNAME]);
			SenderDisplayName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_SENDERDISPLAYNAME]);
		}

		#region Properties 
		#region Property <Guid> BatchID
		[Property("BatchID", 16, SqlDbType.UniqueIdentifier, false, true)]
		public Guid BatchID 
		{
			get { return _BatchID; }
			set { _BatchID = value; }
		}
		private Guid _BatchID = Guid.Empty;
		#endregion

		#region Property <DateTime> SendTime
		[Property("SendTime", 16, SqlDbType.DateTime, false, false)]
		public DateTime SendTime 
		{
			get { return _SendTime; }
			set { _SendTime = value; }
		}
		private DateTime _SendTime = DateTime.MinValue;
		#endregion

		#region Property <string> Text
		[Property("Text", 2147483646, SqlDbType.NText, false, false)]
		public string Text 
		{
			get { return _Text; }
			set { _Text = value; }
		}
		private string _Text = null;
		#endregion

		#region Property <short> Status
		[Property("Status", 2, SqlDbType.SmallInt, false, false)]
		public short Status 
		{
			get { return _Status; }
			set { _Status = value; }
		}
		private short _Status = short.MinValue;
		#endregion

		#region Property <string> FileName
		[Property("FileName", 100, SqlDbType.NVarChar, false, false)]
		public string FileName 
		{
			get { return _FileName; }
			set { _FileName = value; }
		}
		private string _FileName = null;
		#endregion

		#region Property <string> SenderName
		[Property("SenderName", 100, SqlDbType.NVarChar, false, false)]
		public string SenderName 
		{
			get { return _SenderName; }
			set { _SenderName = value; }
		}
		private string _SenderName = null;
		#endregion

		#region Property <string> SenderDisplayName
		[Property("SenderDisplayName", 100, SqlDbType.NVarChar, false, false)]
		public string SenderDisplayName 
		{
			get { return _SenderDisplayName; }
			set { _SenderDisplayName = value; }
		}
		private string _SenderDisplayName = null;
		#endregion
		#endregion




	}
}
